<template>
<view class="page">
	<view class="b-header">
		<pageHeader title="我的团队"></pageHeader>
	</view>
	<view class="content">
		<view class="apparatus margin-30">
			<tki-tree ref="tkitree" :selectParent="false" :multiple="false" :range="data" :foldAll="false" rangeKey="label"></tki-tree>
		</view>
	</view>
<loading v-if="isShow == true"></loading>
</view>
</template>

<script>
var app = getApp();
import loading from "../../components/public/loading";
import tkiTree from '@/components/tki-tree/tki-tree.vue';
export default {
  data() {
    return {
      colors: '#999999',
      dataList: [],
      isShow: true,
	  data:[
		  // {id:1,label:'一级团员',children:[{id:33,label:"一级组员1"},{id:363,label:"一级组员1"},{id:343,label:"一级组员1"},{id:313,label:"一级组员1"},{id:323,label:"一级组员1",money:"金额"}]},
		  // {id:2,label:'二级团员',children:[]},
		  // {id:3,label:'三级团员',children:[]}
	  ],//return { id: 'id', label: 'label', children: 'children' }
    };
  },

  components: {
    loading,
	tkiTree
  },
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      //colors: app.globalData.newColor
    });
    setTimeout(() => {
      this.setData({
        //isShow: false
      });
    }, 600);
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  created() {
  	this.init();
  },
  methods: {
	  nodeClick(){
		  
	  },
	  jumpNext(){
		  uni.showToast({
		  	title:'根据需求进行跳转~',
			icon:'none'
		  })
	  },
	  async init() {
	  	this.isShow = true
	  	var query = {
	  		type:'my_team'
	  	};
	  	 let res = await this.$api.memberData(query).then(res=> {
	  		 console.log("团队列表")
	  			console.log(res)
	  			if(res.code == 0){
	  				this.data = res.data;
	  			}
	  			this.isShow = false;
	  			
	  	 }).catch(err=> { console.log(err) }
	  	 );
	  }
  }
};
</script>
<style lang="scss" scoped>
	.tree-item{
		margin-left: 10px;
	}
.coupon_box{
  margin: 20upx;
  box-shadow: 0upx 0upx 10upx #ddd;
  position: relative;
  border-radius: 10upx;
  overflow: hidden;
}
.coupon_box .left{
  width: 70%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 20upx;
  float: left;
}
.coupon_box .left .hui{
  width: 40upx;
  height: 40upx;
  font-size: 20upx;
  color: #fff;
  background-color: #EC1818;
  border-radius: 8upx;
  line-height: 40upx;
  text-align: center;
  display: inline-block;
  transform: translateY(-5upx);
  margin-left: 50px;
}
.coupon_box .left .left_top{
  width: 60vw;
  display: block;
  font-size: 26upx;
  font-weight: bold;
  
}
.left_top .hui_name{
  line-height: 60upx;
  height: 60upx;
  margin-left: 20upx;
  display: inline-block; 
}
.left_bottom{
  font-size: 24upx;
  font-weight: bold;
  color: #333;
  height: 60upx;
  line-height: 80upx;
}
.coupon_box .right{
  text-align: center;
  height: 190upx;
  width: 180upx;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  background-color: #A8A8A8;
  float: right;
}
.coupon_box .right .shiyong{
  height: 40upx;
  line-height: 40upx;
  background-color: #fff;
  border-radius: 20upx;
  padding: 0 20upx;
  color: #A8A8A8;
}
.coupon_box .right .money{
  font-size: 45upx;
  color: #fff;
}
.coupon_box .right text{
  font-size: 24upx;
  color: #fff;
  height: 40upx;
  line-height: 34upx;
}
.coupon_box .bottom{
  height: 60upx;
  line-height: 60upx;
  display: flex;
  align-content: flex-start;
  font-size: 24upx;
  margin-top: 10upx;
}
.coupon_box .bottom view{
  margin-right: 20upx;
  color: #888;
  font-weight: bold;
}
.ysy{
  width: 80upx;
  height: 80upx;
  position: absolute;
  top: 20upx;
  //right: 200upx;
}
</style>